using Google.ProtocolBuffers;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class CmdItem : GeneratedMessageLite<CmdItem, CmdItem.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<CmdItem, CmdItem.Builder>
		{
			private bool resultIsReadOnly;
			private CmdItem result;
			protected override CmdItem.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override CmdItem MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override CmdItem DefaultInstanceForType
			{
				get
				{
					return CmdItem.DefaultInstance;
				}
			}
			public int CmdId
			{
				get
				{
					return this.result.CmdId;
				}
				set
				{
					this.SetCmdId(value);
				}
			}
			public SKBuiltinBuffer_t CmdBuf
			{
				get
				{
					return this.result.CmdBuf;
				}
				set
				{
					this.SetCmdBuf(value);
				}
			}
			public Builder()
			{
				this.result = CmdItem.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(CmdItem cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private CmdItem PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					CmdItem other = this.result;
					this.result = new CmdItem();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override CmdItem.Builder Clear()
			{
				this.result = CmdItem.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override CmdItem.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new CmdItem.Builder(this.result);
				}
				return new CmdItem.Builder().MergeFrom(this.result);
			}
			public override CmdItem BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override CmdItem.Builder MergeFrom(IMessageLite other)
			{
				if (other is CmdItem)
				{
					return this.MergeFrom((CmdItem)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override CmdItem.Builder MergeFrom(CmdItem other)
			{
				return this;
			}
			public override CmdItem.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override CmdItem.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(CmdItem._cmdItemFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = CmdItem._cmdItemFieldTags[num2];
					}
					uint num3 = num;
					if (num3 == 0u)
					{
						throw InvalidProtocolBufferException.InvalidTag();
					}
					if (num3 != 8u)
					{
						if (num3 != 18u)
						{
							if (WireFormat.IsEndGroupTag(num))
							{
								return this;
							}
							this.ParseUnknownField(input, extensionRegistry, num, text);
						}
						else
						{
							SKBuiltinBuffer_t.Builder builder = SKBuiltinBuffer_t.CreateBuilder();
							if (this.result.hasCmdBuf)
							{
								builder.MergeFrom(this.CmdBuf);
							}
							input.ReadMessage(builder, extensionRegistry);
							this.CmdBuf = builder.BuildPartial();
						}
					}
					else
					{
						this.result.hasCmdId = input.ReadInt32(ref this.result.cmdId_);
					}
				}
				return this;
			}
			public CmdItem.Builder SetCmdId(int value)
			{
				this.PrepareBuilder();
				this.result.hasCmdId = true;
				this.result.cmdId_ = value;
				return this;
			}
			public CmdItem.Builder ClearCmdId()
			{
				this.PrepareBuilder();
				this.result.hasCmdId = false;
				this.result.cmdId_ = 0;
				return this;
			}
			public CmdItem.Builder SetCmdBuf(SKBuiltinBuffer_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasCmdBuf = true;
				this.result.cmdBuf_ = value;
				return this;
			}
			public CmdItem.Builder SetCmdBuf(SKBuiltinBuffer_t.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.hasCmdBuf = true;
				this.result.cmdBuf_ = builderForValue.Build();
				return this;
			}
			public CmdItem.Builder MergeCmdBuf(SKBuiltinBuffer_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				if (this.result.hasCmdBuf && this.result.cmdBuf_ != SKBuiltinBuffer_t.DefaultInstance)
				{
					this.result.cmdBuf_ = SKBuiltinBuffer_t.CreateBuilder(this.result.cmdBuf_).MergeFrom(value).BuildPartial();
				}
				else
				{
					this.result.cmdBuf_ = value;
				}
				this.result.hasCmdBuf = true;
				return this;
			}
			public CmdItem.Builder ClearCmdBuf()
			{
				this.PrepareBuilder();
				this.result.hasCmdBuf = false;
				this.result.cmdBuf_ = null;
				return this;
			}
		}
		public const int CmdIdFieldNumber = 1;
		public const int CmdBufFieldNumber = 2;
		private static readonly CmdItem defaultInstance;
		private static readonly string[] _cmdItemFieldNames;
		private static readonly uint[] _cmdItemFieldTags;
		private bool hasCmdId;
		private int cmdId_;
		private bool hasCmdBuf;
		private SKBuiltinBuffer_t cmdBuf_;
		private int memoizedSerializedSize = -1;
		public static CmdItem DefaultInstance
		{
			get
			{
				return CmdItem.defaultInstance;
			}
		}
		public override CmdItem DefaultInstanceForType
		{
			get
			{
				return CmdItem.DefaultInstance;
			}
		}
		protected override CmdItem ThisMessage
		{
			get
			{
				return this;
			}
		}
		public int CmdId
		{
			get
			{
				return this.cmdId_;
			}
		}
		public SKBuiltinBuffer_t CmdBuf
		{
			get
			{
				return this.cmdBuf_ ?? SKBuiltinBuffer_t.DefaultInstance;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				return this.hasCmdId && this.hasCmdBuf && this.CmdBuf.IsInitialized;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasCmdId)
				{
					num += CodedOutputStream.ComputeInt32Size(1, this.CmdId);
				}
				if (this.hasCmdBuf)
				{
					num += CodedOutputStream.ComputeMessageSize(2, this.CmdBuf);
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private CmdItem()
		{
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] cmdItemFieldNames = CmdItem._cmdItemFieldNames;
			if (this.hasCmdId)
			{
				output.WriteInt32(1, cmdItemFieldNames[1], this.CmdId);
			}
			if (this.hasCmdBuf)
			{
				output.WriteMessage(2, cmdItemFieldNames[0], this.CmdBuf);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasCmdId)
			{
				num ^= this.cmdId_.GetHashCode();
			}
			if (this.hasCmdBuf)
			{
				num ^= this.cmdBuf_.GetHashCode();
			}
			return num;
		}
		public override bool Equals(object object_0)
		{
			CmdItem cmdItem = object_0 as CmdItem;
			return cmdItem != null && (this.hasCmdId == cmdItem.hasCmdId && (!this.hasCmdId || this.cmdId_.Equals(cmdItem.cmdId_))) && (this.hasCmdBuf == cmdItem.hasCmdBuf && (!this.hasCmdBuf || this.cmdBuf_.Equals(cmdItem.cmdBuf_)));
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<CmdItem, CmdItem.Builder>.PrintField("CmdId", this.hasCmdId, this.cmdId_, writer);
			GeneratedMessageLite<CmdItem, CmdItem.Builder>.PrintField("CmdBuf", this.hasCmdBuf, this.cmdBuf_, writer);
		}
		public static CmdItem ParseFrom(byte[] data)
		{
			return CmdItem.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private CmdItem MakeReadOnly()
		{
			return this;
		}
		public static CmdItem.Builder CreateBuilder()
		{
			return new CmdItem.Builder();
		}
		public override CmdItem.Builder ToBuilder()
		{
			return CmdItem.CreateBuilder(this);
		}
		public override CmdItem.Builder CreateBuilderForType()
		{
			return new CmdItem.Builder();
		}
		public static CmdItem.Builder CreateBuilder(CmdItem prototype)
		{
			return new CmdItem.Builder(prototype);
		}
		static CmdItem()
		{
			CmdItem.defaultInstance = new CmdItem().MakeReadOnly();
			CmdItem._cmdItemFieldNames = new string[]
			{
				"CmdBuf",
				"CmdId"
			};
			CmdItem._cmdItemFieldTags = new uint[]
			{
				18u,
				8u
			};
			object.ReferenceEquals(micromsg.Proto.CmdItem.Descriptor, null);
		}
	}
}
